<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020-07-22
 * Time: 11:43
 */
namespace App\Http\Middleware;


use Closure;

class CheckRequestHead
{
    public function __construct()
    {

    }
    public function handle($request, Closure $next)
    {
        $response = $next($request);
        $response->header('Access-Control-Allow-Origin', '*');
        $response->header('Access-Control-Allow-Headers', 'Origin, Content-Type, Cookie, X-CSRF-TOKEN, Accept, Token, User-id, Authorization, X-XSRF-TOKEN');
        $response->header('Access-Control-Expose-Headers', 'Authorization, authenticated');
        $response->header('Access-Control-Allow-Methods', 'GET, POST, PATCH, PUT, OPTIONS');
        $response->header('Access-Control-Allow-Credentials', 'true');
        return $response;
    }
}
